<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>个人信息</title>
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
 	<script src="js/jquery-1.2.6.min.js" type=text/javascript></script>
	<script src="js/formValidator.js" type="text/javascript" charset="UTF-8"></script>
	<script src="js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$.formValidator.initConfig({formid:"form1",debug:false,submitonce:true,
				onerror:function(msg,obj,errorlist){
					//$.map(errorlist,function(msg1){alert(msg1)});
					alert(msg);
				}
			});
			/*只可为数字或字母
			$("#t_UserName").formValidator({onshow:"5-10个字符",onfocus:"5-10个字符",oncorrect:"该用户名可以注册"})
			.inputValidator({min:5,max:10,onerror:"输入有误"})
			.regexValidator({regexp:"username",datatype:"enum",onerror:"格式有误"});
			*/
			
		    
			
			$("#iptName").formValidator({onshow:"至少4个字符",onfocus:"至少4个字符",oncorrect:"通过"})
			.inputValidator({min:4,empty:{
			leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
			$("#iptCard").formValidator({onshow:"15或18位的身份证",onfocus:"15或18位的身份证",oncorrect:"输入正确"}).functionValidator({fun:isCardID});
			$("#t_Email").formValidator({
			onshow:"6-100个字符",onfocus:"6-100个字符",oncorrect:"恭喜你,你输对了",defaultvalue:""})
			.inputValidator({min:6,max:100,onerror:"长度非法"}).
			regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$"
			,onerror:"格式不正确"});
			$("#Phone").formValidator({empty:false,onshow:"请输入你的联系电话",
			onfocus:"如：0577-88888888",oncorrect:"谢谢你的合作",onempty:"电话不能为空"})
			.regexValidator({regexp:"^[[0-9]{3}-|\[0-9]{4}-]?([0-9]{8}|[0-9]{7})?$",
			onerror:"格式不正确"});
		    $("#ZipCode").formValidator({onshow:"请输入邮编",onfocus:"例如:325000",oncorrect:"邮编正确"})
		    .regexValidator({regexp:"zipcode",datatype:"enum",onerror:"邮编格式不正确"});
			$("#Address").formValidator({onshow:"输入地址",onfocus:"至少2个字符",oncorrect:"通过"})
			.inputValidator({min:4,max:10,empty:{
			leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
			$("#Birthday").formValidator({empty:false,onshow:"请输入你的生日",
			onfocus:"形如 :2003-12-10",oncorrect:"谢谢你的合作",onempty:"生日不能为空"})
			.regexValidator({regexp:"^([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))$",
			onerror:"格式不正确"});
	});
	</script>
	  <style>
            .wrapper{ width:1198px;  margin-top:-50px; float:left; padding-bottom:37px;}
            .wrapper_left{ width:661px; float:left; padding-left:50px; margin-top:20px; background:url(/images/y20.jpg) repeat-y right top;  overflow:hidden;}
            .wrapper01{ width:700px; float:left; border-bottom:2px solid rgb(41, 143, 215);font-size:18px; color:#2791e3; font-family:"微软雅黑"; padding-bottom:20px;margin-bottom:20px}
            .wrapper_div{  width:600px;  float:left;  }
            .content{ width:1200px; margin:0 auto; overflow:hidden;}
            .instructions{ width:1197px; float:left; height:35px; line-height:37px; color:#2791e3; font-family:"宋体"; font-size:12px; padding-left:3px; border-bottom:#2791e3 solid 2px;}
            .instructions a{ color:#2791e3; font-family:"宋体"; font-size:12px; text-decoration:none;}
            .instructions a:hover{ color:#2791e3; font-family:"宋体"; font-size:12px; text-decoration:underline;}
            .instructions span{ color:#333333; font-family:"宋体"; font-size:12px;}
            #button{ width:130px; height:29px; border:none; background:#2791e3; color:#fff; font-size:16px; font-family:"微软雅黑"; line-height:29px; cursor:pointer;}


	    .content_form{margin-top:30px;}
	      .onShow,.onFocus,.onError,.onCorrect,.onLoad{
	         background:url(img/reg_bg.png) no-repeat 3000px 3000px;
	         padding-left:30px; 
	         font-size: 12px; 
	         height:25px; 
	         width:124px; 
	         display:inline-block; 
	         line-height:25px; 
	         vertical-align:middle; 
	         overflow:hidden; 
	         margin-left:6px;
	         margin-bottom:8px}
		  .onShow{color:#999; padding-left:0px}
		  .onFocus{background-position:0px -30px; color:#333}
		  .onError{background-position:0px -60px; color:#333}
		  .onCorrect{background-position:0px 0; text-indent:-9000px}
		  .onLoad{background-position:0px 0}
	      #t_UserName,#t_UserPass,#t_RePass,#iptName,#t_Email,#Address,#Phone,#ZipCode,#Birthday{
	       font-size:13px;
	       height:24px;
	      }
	  </style>
  </head>
 
  <body>
      <div class="content">

  	 <div class="wrapper">	
      	  <form name="form1" id="form1" class="content_form" action="<c:url value="frontUserMgr" />" method="post" >
              <input type="hidden" name="act" value="updateInfo"/>
             
              <div class="wrapper_left">

              <div class="wrapper01">个人信息</div>

              <div class="wrapper_div">
                  <span>用户账号:</span>
                  <input type="text" style="width:160" id="t_UserName" name="user_name" value="${user.userName}" readonly="readonly"/>
            	  <span style="color:red;font-size:15px";>&nbsp&nbsp不可修改</span>
              </div>
             <div class="wrapper_div">
                  <span>真实姓名:</span>
                  <input type="text" name="user_rel_name" id="iptName" value="${user.realName}"/>
                  <span id="iptNameTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>出生日期:</span>
                  <input type="text" name="user_birthday" id="Birthday" value="${user.birthday}"/>
             	  <span id="BirthdayTip" class="onshow"></span>
              </div>
           
              <div class="wrapper_div">
                  <span>性别:&nbsp&nbsp&nbsp&nbsp</span>
                      男<input type="radio" name="user_sex" value="0" <c:if test="${user.sex==0}">checked="checked"</c:if>/>
                      女<input type="radio" name="user_sex" value="1" <c:if test="${user.sex==1}">checked="checked"</c:if>/>
              </div>
              <div class="wrapper_div">
                  <span>电子邮箱:</span>
                  <input type="text" name="user_email"  id="t_Email" value="${user.email}"/>
                  <span id="t_EmailTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>电话号码:</span>
                  <input type="text" name="user_phone_code"  id="Phone" value="${user.phoneCode}"/>
                   <span id="PhoneTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>居住地址:</span>
                  <input type="text" name="user_addr" id="Address" value="${user.address}"/>
                   <span id="AddressTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>邮 编:&nbsp&nbsp&nbsp</span>
                  <input type="text" name="user_zipcode" id="ZipCode" value="${user.zipCode}"/>
                   <span id="ZipCodeTip" class="onshow"></span>
              </div>

              <div class="wrapper_div">
                  <input id="button" name="button"  type="submit" value="修改" class="btn btn-primary"/> 
              </div>
              </div>
              <c:if test="${not empty error}">
              	<script type="text/javascript">
              		alert("${error}");
              	</script>
              </c:if>
          </form>
     </div> 
</div>
  </body>
</html>
